home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / lib / partman / update.d / 50filesystems < prev    next >
Encoding:
Text File  |  2007-04-12  |  1.3 KB  |  74 lines

  1. #!/bin/sh
  2.  
  3. . /lib/partman/definitions.sh
  4.  
  5. dev=$1
  6. num=$2
  7. id=$3
  8. size=$4
  9. type=$5
  10. fs=$6
  11. path=$7
  12. name=$8
  13.  
  14. cd $dev
  15.  
  16. [ -d $id ] || mkdir $id
  17.  
  18. if [ $fs = free ]; then
  19.     rm -f $id/method
  20. fi
  21.  
  22. if [ ! -f $id/method ] || [ ! -f $id/use_filesystem ]; then
  23.     rm -f $id/acting_filesystem
  24.     exit 0
  25. fi
  26.  
  27. if [ -f $id/filesystem ]; then
  28.     cp $id/filesystem $id/acting_filesystem
  29. else
  30.     rm -f $id/acting_filesystem
  31. fi
  32.  
  33. open_dialog PARTITION_INFO $id
  34. read_line num id size type fs path name
  35. close_dialog
  36.  
  37. acting_filesystem=''
  38. if
  39.     [ -f $id/acting_filesystem ] \
  40.     && acting_filesystem=$(cat $id/acting_filesystem) \
  41.     && [ -f /lib/partman/parted_names/$acting_filesystem ] \
  42.     && new_fs=$(cat /lib/partman/parted_names/$acting_filesystem) \
  43.     && [ "$fs" != "$new_fs" ]
  44. then
  45.     open_dialog CHANGE_FILE_SYSTEM $id $new_fs
  46.     close_dialog
  47. fi
  48.  
  49. existing=no
  50. formatable=no
  51.  
  52. for i in /lib/partman/valid_filesystems/*; do
  53.     [ -x $i ] || continue
  54.     if [ "`$i $dev $id existing`" = "$acting_filesystem" ]; then
  55.     existing=yes
  56.     fi
  57.     if [ "`$i $dev $id formatable`" = "$acting_filesystem" ]; then
  58.     formatable=yes
  59.     fi
  60. done
  61.  
  62. if [ $existing = yes ]; then
  63.     > $dev/$id/existing
  64. else
  65.     rm -f $dev/$id/existing
  66. fi
  67.  
  68. if [ $formatable = yes ]; then
  69.     > $dev/$id/formatable
  70. else
  71.     rm -f $dev/$id/formatable
  72. fi
  73.  
  74.